package com.umeox.zikrringtest

import android.app.Application
import com.umeox.logger.UMLogger
import kotlin.system.exitProcess

object CrashHandler : Thread.UncaughtExceptionHandler {

    private var app : Application? = null

    fun init(application: Application) {
        app = application
        Thread.setDefaultUncaughtExceptionHandler(this)
    }

    override fun uncaughtException(t: Thread, e: Throwable) {
        UMLogger.e("uncaughtException-->" , e.toString(),e);
        Thread.sleep(1000)
        android.os.Process.killProcess(android.os.Process.myPid())
        exitProcess(0)
    }
}